<?php

require_once __DIR__ . '/vendor/autoload.php';

use support\Db;
use app\model\BizAdminModel;
use app\model\AdminModel;

// 测试数据库连接
try {
    // 测试查询admin表
    $admins = AdminModel::query()->select('id', 'username')->where('status', 1)->get();
    echo "Admin表数据:\n";
    foreach ($admins as $admin) {
        echo "ID: {$admin->id}, Username: {$admin->username}\n";
    }
    
    // 测试查询biz_admin表
    $bizAdmins = BizAdminModel::query()->get();
    echo "\nBizAdmin表数据:\n";
    foreach ($bizAdmins as $bizAdmin) {
        echo "ID: {$bizAdmin->id}, BizID: {$bizAdmin->biz_id}, UserID: {$bizAdmin->user_id}, Role: {$bizAdmin->role}, Status: {$bizAdmin->status}\n";
    }
    
    echo "\n测试完成！\n";
    
} catch (Exception $e) {
    echo "错误: " . $e->getMessage() . "\n";
} 